<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
        <p>加油加油加油</p>
</body>
   <script>
       var arr = new Array(16)
       console.log(arr)
       for(var i = 0;i < arr.length;i++){
           arr[i]=0
       }
       var randomNumber = Math.random()
       randomNumber *=16
       var number = Math.floor(randomNumber)
       console.log(number);
       var randomNumber=Math.random()
       var seed
       if(randomNumber<0.5){
           seed = 2
       }else{
           seed = 4
       }
       console.log(number)
       arr[number] = seed
       console.log(arr)
   </script>
</html>